package com.rabbitmq.directdemo.lstener;

import com.rabbitmq.directdemo.config.DirectConfig;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

//需要被spring容器管理
@Component
/**
 * 接收方式一
 */
public class FanoutListener01 {
    @RabbitListener(queues = DirectConfig.DIRECT_QUEUE+"_01")
    public void getMessage01(String message){
        System.out.println("queue01 :"+message);
    }
    @RabbitListener(queues = DirectConfig.DIRECT_QUEUE+"_02")
    public void getMessage02(String message){
        System.out.println("queue02 :"+message);
    }
    @RabbitListener(queues = DirectConfig.DIRECT_QUEUE+"_03")
    public void getMessage03(String message){
        System.out.println("queue03 :"+message);
    }
}
